package org.xi.behavioral.strategy.context;

import org.xi.behavioral.strategy.api.TravelStrategy;

public class Traveler {
    private TravelStrategy strategy;

    public void setTravelStrategy(TravelStrategy strategy) {
        this.strategy = strategy;
    }

    public void startJourney() {
        if (strategy != null) {
            strategy.travel();
        } else {
            System.out.println("还没有选择出行方式！");
        }
    }
}